package pkg.chemdrm;

import org.anddev.andengine.engine.camera.BoundCamera;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.handler.timer.ITimerCallback;
import org.anddev.andengine.engine.handler.timer.TimerHandler;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.Scene.IOnSceneTouchListener;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.text.Text;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.input.touch.controller.ITouchController.ITouchEventCallback;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.util.HorizontalAlign;

import android.content.Context;

public class HelpScene
extends ChemScene
{

	// declare text
	private final Text mBackText;
	private final Text mObjectiveText;
	private final Text mMovementText;
	private final Text mAttackText;
	

	public HelpScene(final Context pContext, final SceneHandler pSceneHandler, final ResourceHandler pResourceHandler, final BoundCamera pCamera)
	{
		
		super(pContext, pSceneHandler, pResourceHandler, pCamera);
		buildScene();
		
		mBackText = new Text(0, 0, mResourceHandler.getFont(), "Back", HorizontalAlign.LEFT)
		{
			@Override
			public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
			{
				// when we touch the title, go to the current working game.
				mSceneHandler.setScene("MainMenu");
				return true;
			}
		};
				
		mObjectiveText = new Text(0, 50, mResourceHandler.getFont(), "Objective", HorizontalAlign.LEFT)
		{
			@Override
			public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
			{
				// when we touch the title, go to the current working game.
				mSceneHandler.setScene("Objective");
				return true;
			}
		};
				
		mMovementText = new Text(0, 100, mResourceHandler.getFont(), "Movement", HorizontalAlign.LEFT)
		{
			@Override
			public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
			{
				// when we touch the title, go to the current working game.
				mSceneHandler.setScene("Movement");
				return true;
			}
		};
		
		mAttackText = new Text(0, 150, mResourceHandler.getFont(), "Attack", HorizontalAlign.LEFT)
		{
			@Override
			public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
			{
				// when we touch the title, go to the current working game.
				mSceneHandler.setScene("Attack");
				return true;
			}
		};
		
		attachChild(mBackText);
		attachChild(mObjectiveText);
		attachChild(mMovementText);
		attachChild(mAttackText);
		
		registerTouchArea(mBackText);
		registerTouchArea(mObjectiveText);
		registerTouchArea(mMovementText);
		registerTouchArea(mAttackText);

	}

	private void buildScene()
	{
		setBackground(new ColorBackground(1f, 1f, 1f));
	}

}
